#ifndef __CAN_HW_H_
#define __CAN_HW_H_

#include <xmc4500/can_drv.h>
#include <xmc4500/types_local.h>


/* CAN System baud rate selectors
*-------------------------------
* -These constants are used to lookup the baud rate in the btr[] array.
*/
enum can_baud_rates
{
    CAN_10KBAUD = -4, // -4
    CAN_20KBAUD,      // -3
    CAN_50KBAUD,      // -2
    CAN_100KBAUD,     // -1
    CAN_125KBAUD,     //  0
    CAN_250KBAUD,     //  1
    CAN_500KBAUD,     //  2
    CAN_800KBAUD,     //  3
    CAN_1000KBAUD,    //  4
    CAN_BAD_BAUD
};

/*============================================================================
  function-prototype                                                      */


extern volatile s8 can_port_ext_transmiting;
extern volatile s8 can_port_int_transmiting;

extern XMC_CAN_MO_t can_ext_mo_hi;

extern void receive_can_messages_tic(void);
extern void transmit_can_messages_ext(void);
extern void transmit_can_messages_int(void);

extern int can_got_a_message(void);
extern void can_hardware_init(void);
extern void can_hardware_test_tic(void);
extern s16 mailbox_vInit(s8 port, s32 acceptance_id);
extern void set_mailbox_assigned_flag(s16 mailbox_no);
extern void set_up_pending_flag(s16 mailbox_no);


#endif
